@extends('admin.layout.main')
@section('content')
    <link rel="stylesheet" href="{{asset('/css/bootstrap-switch.css')}}">
    <style type="text/css">
      .left-filter{margin-left:8px;}
    </style>
    <section class="content-header">
      <h1>
        消费记录
      </h1>
      <ol class="breadcrumb">
        <li><a href="javascript:void(0)"><i class="fa fa-dashboard"></i> 游戏用户</a></li>
        <li class="active">消费记录</li>
      </ol>
    </section>
    <section class="content">
        <!-- Small boxes (Stat box) -->
        <div class="row">
            <div class="col-lg-12 col-xs-6">
                <div class="box">
                    <div class="box-header with-border">
                    </div>
                    
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table style="table-layout: fixed" class="table table-bordered table-hover" id="user-list">
                            <thead>
                                <tr>
                                    <th style="width: 50px"><a style="cursor:pointer" class="all_check">全选</a></th>
                                    <th>订单编号</th>
                                    <th>订单金额</th>
                                    <th>支付时间</th>
                                    <th>商品名称</th>
                                    <th>商品数量</th>
                                </tr>
                            </thead>    
                            <tbody> 
                                @foreach($costs as $cost)
                                    <tr id="{{$cost->id}}">
                                        <td><input type="checkbox" name="checkbox_member" class="checkbox_member" user-id="{{$cost->id}}"></td>
                                        <td>{{$cost->order_sn}}</td>
                                        <td>{{$cost->order_amount}}</td>
                                        <td>{{$cost->updated_at}}</td>
                                        <td>{{$cost->goodsName()}}</td>
                                        <td>{{$cost->goodsCount()}}</td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                        {{$costs->links()}}
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- datepicker -->
    <script src="{{asset('/js/bootstrap-switch.min.js')}}"></script>
    <script type="text/javascript">
        $(function () {
            $('#user-list').DataTable({
              "paging": false,
              "lengthChange": false,
              "searching": false,
              "info": false,
              "autoWidth": true,
              "columns": [
                {"orderable": false},
                {"orderable": false},
                {"orderable": false},
                {"orderable": true},
                {"orderable": true},
                {"orderable": false}
              ]
            });
        });

        $('.all_check').click(function(){
            $('.checkbox_member').click();
        });
    </script>
@endsection      